module.exports = {
    configureWebpack: {
      // Webpack configuration applied to web builds and the electron renderer process
    },
    pluginOptions: {
      electronBuilder: {
		electronDownload:{
			mirror:"https://registry.npmmirror.com/binary.html?path=electron/"
		},
		outputDir: 'dist',
        chainWebpackMainProcess: (config) => {
          // Chain webpack config for electron main process only
        },
        chainWebpackRendererProcess: (config) => {
          // Chain webpack config for electron renderer process only (won't be applied to web builds)
        },
        nodeIntegration:false,
        preload: 'src/electron/preload/index.ts',
        // Use this to change the entrypoint of your app's main process
        mainProcessFile: 'src/electron/main/index.ts',
        // Use this to change the entry point of your app's render process. default src/[main|index].[js|ts]
        rendererProcessFile: 'src/main.ts',
        // Provide an array of files that, when changed, will recompile the main process and restart Electron
        // Your main process file will be added by default
        mainProcessWatch: ['src/electron/main/index.ts', 'src/electron/preload/index.ts'],
        // Provide a list of arguments that Electron will be launched with during "electron:serve",
        // which can be accessed from the main process (src/background.js).
        // Note that it is ignored when --debug flag is used with "electron:serve", as you must launch Electron yourself
        // Command line args (excluding --debug, --dashboard, and --headless) are passed to Electron as well
        // mainProcessArgs: ['--arg-name', 'arg-value']
		
		builderOptions:{
			productName:"Electron Demo",
			asar:true,
			copyright:"Copryight(c) 2022 xiaobaozi",
			afterSign: "build/notarize.js",
			win: {
				icon: "./public/logo.png", //图标路径,
				target: [{
					target: 'nsis', // 利用nsis制作安装程序
					'arch': [
						'x64', // 64位
					]
				}]
			},
			mac: {
				hardenedRuntime: true,
				gatekeeperAssess:false,
				entitlements: "build/entitlements.mac.plist",
				entitlementsInherit: "build/entitlements.mac.plist",
				icon: "./public/logo.png", //图标路径
				target: {
					arch: "universal",
					target: 'default'
				}
			},
			nsis: {
				oneClick: false, // 一键安装
				perMachine: false, // 是否开启安装时权限限制（此电脑或当前用户）
				allowElevation: true, // 允许请求提升。 如果为false，则用户必须使用提升的权限重新启动安装程序。
				allowToChangeInstallationDirectory: true, // 允许修改安装目录
				installerIcon: "./public/logo.ico", // 安装图标
				uninstallerIcon: "./public/logo.ico", //卸载图标
				installerHeaderIcon: "./public/logo.ico", // 安装时头部图标
				createDesktopShortcut: true, // 创建桌面图标
				createStartMenuShortcut: true, // 创建开始菜单图标
			},
			linux: {
				icon: "./public/logo.png", //图标路径
				// target:{
				// 	arch:'x64',
				// 	target:'deb'
				// }
			},
			publish: [
				{
				  "provider": "generic",
				  "url": "",//更新服务器地址,可为空
				}
			  ],
			// extraResources:[
			// 	{
			// 		from:'public',
			// 		to:"static",
			// 	}
			// ]
		}
      }
    }
  }